<template>
	<text class="copy" @tap="onCopy" :style="styleClass">
		复制
	</text>
</template>

<script setup>
import { reactive, ref, defineProps } from 'vue'

const props = defineProps({
	context: {
		type: String,
		default: ''
	},
	text: {
		type: String,
		default: '复制'
	},
	styleClass: {
		type: Object,
		default: () => {}
	}
})

// 点击复制
const onCopy = () => {
	uni.setClipboardData({
		data: props.context, // 要复制的文本
	 success() {
			uni.showToast({ title: "复制成功", icon: "success" });
	 },
	});
}
</script>

<style lang="scss">

</style>